import { extend } from 'umi-request';

function genApi() {
  const majorConfig = {
    timeout: 10000,
  };
  const request = extend({
    ...majorConfig,
  });

  request.interceptors.response.use(async (response: any) => {
    return response || {};
  });

  return request;
}

export default genApi();
